package com.redfox.newapp.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.redfox.newapp.R;

import uk.co.senab.photoview.PhotoViewAttacher;

public class PhotoActivity extends AppCompatActivity {
    private ImageView mImageView;
    private PhotoViewAttacher mAttacher;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_photo);

        Bundle bundle = this.getIntent().getExtras();
        String url = "";
        if (bundle != null)
            url = bundle.getString("url");

        // Any implementation of ImageView can be used!
        mImageView = (ImageView) findViewById(R.id.photo);

        // Set the Drawable displayed
        Glide.with(this)
                .load(url)
                .into(mImageView);

        // Attach a PhotoViewAttacher, which takes care of all of the zooming functionality.
        // (not needed unless you are going to change the drawable later)
        mAttacher = new PhotoViewAttacher(mImageView);

    }
}
